package String;

public class _553_OptimalDivision {
    //hint:for the max value,the dividend should be max,and the divisor should be min,so the first num be the dividend,the rest numbers
    //divide one by one for the min divisor
    public String optimalDivision(int[] nums) {
        if (nums.length == 1) {
            return nums[0]+"";
        } else if (nums.length == 2) {
            return nums[0]+"/"+nums[1] + "";
        } else {
            String result = nums[0]+"/(";
            for(int i=1;i<nums.length;i++) {
                result+=nums[i]+"/";
            }
            result = result.substring(0, result.length()-1);
            result += ")";
            return result;
        }

    }
}
